package com.puyuba.puyuba.view.adapter;

import androidx.core.content.ContextCompat;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.puyuba.puyuba.R;
import com.puyuba.puyuba.bean.TextselectBean;

/**
 * 选择职业需求adapter
 */
public class ChooseNeedAdatper extends BaseQuickAdapter<TextselectBean,BaseViewHolder> {

    public ChooseNeedAdatper(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, TextselectBean item) {

        helper.addOnClickListener(R.id.btn_choose);
        helper.setText(R.id.btn_choose,item.getName());

        boolean select = item.isSelect();
        if (select){
            helper.setBackgroundRes(R.id.btn_choose,R.drawable.bg_004d80_dp9);
            helper.setTextColor(R.id.btn_choose, ContextCompat.getColor(mContext,R.color.white));
        }else {
            helper.setBackgroundRes(R.id.btn_choose,R.drawable.shape_input_bg);
            helper.setTextColor(R.id.btn_choose,ContextCompat.getColor(mContext,R.color.color_9B));
        }
    }
    
}
